package com.sh.data.engine.application.model.request.integration;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
@Schema
public class OfflineTaskNodeRequest {

    @Schema(description = "节点id")
    private Long id;

    @NotNull(message = "父节点不能为空")
    @Schema(description = "父节点id")
    private Long pid;

    @NotNull(message = "节点名称不能为空")
    @Length(min = 2, max = 64, message = "名称长度为2-64个字符")
    @Pattern(regexp = "[a-zA-Z0-9_\\u4e00-\\u9fa5]+", message = "名称支持中文、字母、数字、下划线")
    @Schema(description = "节点名称")
    private String name;

    @NotNull(message = "节点类型不能为空")
    @Schema(description = "节点类型 0-离线任务")
    private Integer nodeType;
}
